# #
# # import sqlite3
# # import pandas as pd
# # from glob import glob
# # from tqdm import tqdm
# #
# # sqlite3_db_path = "F:\\sky_pile_five\\data.db"  # SQLite3 数据库路径
# # paths = glob("F:/sky_pile_four/*.pkl")  # 获取所有 .pkl.zip 文件路径
# #
# # import sqlite3
# #
# # # 连接到 SQLite 数据库
# # conn = sqlite3.connect(sqlite3_db_path)
# #
# # # 创建一个游标对象
# # cursor = conn.cursor()
# #
# # # 执行 PRAGMA table_info 查询
# # cursor.execute("""CREATE TABLE temp_unique AS
# # SELECT * FROM my_table
# # WHERE rowid IN (
# #     SELECT MIN(rowid)
# #     FROM my_table
# #     GROUP BY "0", "1", "2"
# # );""")  # 将 your_table_name 替换为实际的表名
# #
# # # 获取并打印结果
# # columns = cursor.fetchall()
# # for column in columns:
# #     print(column)
# #
# # # 关闭连接
# # cursor.close()
# # conn.close()
#
#
#
# import sqlite3
# import pandas as pd
# from glob import glob
# from tqdm import tqdm
#
# sqlite3_db_path = "F:\\sky_pile_five\\data.db"  # SQLite3 数据库路径
# paths = glob("F:/sky_pile_four/*.pkl")  # 获取所有 .pkl.zip 文件路径
#
# import sqlite3
#
# # 连接到 SQLite 数据库
# conn = sqlite3.connect(sqlite3_db_path)
#
# # 创建一个游标对象
# cursor = conn.cursor()
#
# # 执行 PRAGMA table_info 查询
# # cursor.execute("""DROP TABLE IF EXISTS my_table;""")  # 将 your_table_name 替换为实际的表名
# cursor.execute("""DROP TABLE IF EXISTS my_table;""")  # 将 your_table_name 替换为实际的表名
#
# # 获取并打印结果
# columns = cursor.fetchall()
# for column in columns:
#     print(column)
#
# # 关闭连接
# cursor.close()
# conn.close()


import sqlite3

# 连接到SQLite数据库（或创建一个新的）
sqlite3_db_path = "F:\\sky_pile_five\\data.db"
conn = sqlite3.connect(sqlite3_db_path)

try:
    # 创建一个游标对象
    cursor = conn.cursor()

    # 执行查询所有表的SQL命令
    cursor.execute("SELECT COUNT(*) FROM  temp_unique;")

    # 获取所有结果
    tables = cursor.fetchall()

    print("Tables in the database:")
    for table in tables:
        print(table[0])
except sqlite3.Error as e:
    print(f"An error occurred: {e}")
finally:
    # 关闭连接
    conn.close()
